package com.haoze.nurseapp.dao;


import com.haoze.common.model.TaskExecuteBatchEntity;
import com.haoze.nurseapp.dto.task.TaskExecuteBatchDTO;
import com.haoze.nurseapp.model.*;
import com.haoze.nurseapp.vo.specimen.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author wangze
 * @date 2020-05-20 15:26.
 **/
public interface SpecimenMapper {


	SpecimenDetailVO querySepcimen(String sepcimenNum);


	/**
	 * 根据标本，获取所有医嘱id
	 * @param speimenNums
	 * @return
	 */
	List<String> queryOrderIds(@Param("speimenNums") List<String> speimenNums);

	/**
	 * 根据单个标本，获取所有医嘱id
	 * @param specimen
	 * @return
	 */
	List<SpecimenOrderVO> queryOrderIdsBySpecimen(String specimen);



	List<SpecimenNodeInfoVO> querySpecimenNodeStatus2(String orderId);


	/**
	 * 获取文书值
	 * @param sepcimenNum
	 * @return
	 */
	List<FileIndexValueVO> queryFileValue(String sepcimenNum);

	/**
	 * 查询当前任务执行最新状态详情
	 * @param inpatOrderId
	 * @return
	 */
	List<TaskExecuteDetailEntity> queryTaskExecuteDetail(@Param("orderId") String inpatOrderId);

	/**
	 * 查询检验相关信息
	 * @param specimenNum
	 * @return
	 */
	List<SpecimenLabItemVO> querySepcimenLabItem(String specimenNum);

	/**
	 * 查询任务流批次号
	 * @param detailId
	 * @return
	 */
	TaskExecuteBatchEntity  queryMaxExecuteBatch(@Param("detailId") String detailId);



	/**
	 *标本待转运列表
	 */
	List<TaskExecuteBatchDTO> queryLabWaitTransfer(@Param("specimenNum") String specimenNum,@Param("taskBatchId") String[] taskBatchId,
												   @Param("wardId") String wardId,@Param("wholeInpatNum") String wholeInpatNum);

	/**
	 *根据主键查询信息
	 */
	TaskExecuteBatchEntity  queryTaskExecuteBatchById(@Param("taskBatchId") String taskBatchId);

	/**
	 *根据主键修改转运人信息
	 */
	int updateTaskExecuteBatchById(@Param("otherExecutePersonId") String otherExecutePersonId,@Param("taskBatchId") String taskBatchId);

	/**
	 *历史转运标本列表
	 */
	List<TaskExecuteBatchDTO>  queryLabHistoryTransfer(@Param("startDate") String startDate,@Param("endDate") String endDate,
													   @Param("keyWords") String keyWords,@Param("taskBatchId") String[] taskBatchId,
													   @Param("wardId") String wardId,@Param("wholeInpatNum") String wholeInpatNum);


	/**
	 * 根据住院号，电子申请单编号查询患者信息
	 */
	TaskExecuteBatchDTO queryPatientLabInfo(@Param("specimenNum") String specimenNum,@Param("reqNum") String[] reqNum, @Param("serialNumber") String serialNumber);


	/**
	 * 根据住院号，电子申请单编号查询患者信息
	 */
	List<PatientLabReportEntity> queryPatientLabReportByReqNum(@Param("reqNum") String[] reqNum, @Param("serialNumber") String serialNumber);

	/**
	 * 根据病区获取护工信息
	 * @return
	 */
	List<SysNurseCareEntity> queryNurseWorkerList(@Param("keyWords") String keyWords);

	/**
	 * 根据标本号查询标本名称和医嘱id
	 * @param specimenNum
	 * @return
	 */
	Map<String,String> queryPatientLabSepcimenBySpecimenNum(@Param("specimenNum") String specimenNum);

	/**
	 * 新增双人核对log
	 * @param doubleCheckLogEntity
	 * @return
	 */
	int insertDoubleCheckLog(DoubleCheckLogEntity doubleCheckLogEntity);

	/**
	 * 修改双人核对log
	 * @param doubleCheckLogEntity
	 * @return
	 */
	int updateDoubleCheckLog(DoubleCheckLogEntity doubleCheckLogEntity);

	String selectHspBasicDataValue(@Param("name") String name);

	int insertSysTestTubeColor(SysTestTubeColorEntity sysTestTubeColorEntity);

	String selectSysTestTubeColorBySpecimenNum(@Param("specimenNum") String specimenNum);
}
